UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6pJutO5u+smaz7ZUAFn6oC6hLkpmuidgcYXnhRCfTog='
WHERE
key_id = '57b2a4a15ee04a0093332cd90a178edaa3cc6cc56e706f4d4b734f495d330c4e'
AND (
token = '6pJutO5u+smaz7ZUAFn6oC6hLkpmuidgcYXnhRCfTog='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)