UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MlREzSfJE1FreifBoKzhKY8FABuDDnC4fXExo2vN3fY='
WHERE
key_id = '6028712c6dba68f9c5b5b87aeaee63da5772582a5d7f67a73e94e8bd2683a031'
AND (
token = 'MlREzSfJE1FreifBoKzhKY8FABuDDnC4fXExo2vN3fY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)