UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wrdnTew+ozKgg+Bomi89V0nLgprqtzU8xUeGpUF/3S8='
WHERE
key_id = 'ffc14c4885b23216772eade10fe9d3b76289ba8bf4a4a9d3b5c3905c3dd9b125'
AND (
token = 'wrdnTew+ozKgg+Bomi89V0nLgprqtzU8xUeGpUF/3S8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)