UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C2yaT/prYGnTN8IT8bmgswO/EyJigJQa7g49NMfXD6E='
WHERE
key_id = '2a858d4ca6fbcd2006deb00866c13d3f6401ce9695d98b0895632e5da1af6eb7'
AND (
token = 'C2yaT/prYGnTN8IT8bmgswO/EyJigJQa7g49NMfXD6E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)