UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qFETEMAsfbaE/8db5Y9VOKxquiBRmgvoq5Ns+OLwq0E='
WHERE
key_id = 'b60219a55ceb185e2e63f3dacb915701860269b15e79d9ab914d21d825f39521'
AND (
token = 'qFETEMAsfbaE/8db5Y9VOKxquiBRmgvoq5Ns+OLwq0E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)