UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UO5btkJFl7ERJO167a3EmSBiFact1BnZyC3tz+iOpwk='
WHERE
key_id = 'e1129497bd8b394976954c7addead3e2eefe832feb81fa4983f27df095e6a681'
AND (
token = 'UO5btkJFl7ERJO167a3EmSBiFact1BnZyC3tz+iOpwk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)