UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QJ9AtOifLkcbMi5Bbz9bPIRLveOyLJXU8XXEZdOBanE='
WHERE
key_id = '9e67cc3af9c50af26346b6313baa4bbd1f1f8e65d331fed3d9d20f2230890db5'
AND (
token = 'QJ9AtOifLkcbMi5Bbz9bPIRLveOyLJXU8XXEZdOBanE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)