UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WtWM/l31zo1TG9D3DPdS7mXPjd/IV20F8KY6sd4e0QU='
WHERE
key_id = 'a4633d8c21a677ec54e6b725cc673c032f96000067a886c7e1ab56c7eaee507b'
AND (
token = 'WtWM/l31zo1TG9D3DPdS7mXPjd/IV20F8KY6sd4e0QU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)