UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rH3YuZqMX5d+ot07jT/2BBEbzYtJoZIsAUPMSyd16WQ='
WHERE
key_id = '298a2d6af478107c623706b41892a09e5492f0def4aff70275007c4505a29078'
AND (
token = 'rH3YuZqMX5d+ot07jT/2BBEbzYtJoZIsAUPMSyd16WQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)