UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cbQmhWUferSu98lS0T48oWsPrGcAGnsQ4qbI9ltzidI='
WHERE
key_id = '17095bdeec4a71e213504243f07e62f6d6bddc7dbfa7aa08b54cb6a6d087ec4d'
AND (
token = 'cbQmhWUferSu98lS0T48oWsPrGcAGnsQ4qbI9ltzidI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)