UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OHRn3i2yIyq0c+k5GIQXSIas/Ep2Fon9pDUj5goFUEw='
WHERE
key_id = '3bc8254da920b1f0630bc77024de0b59b0cadee149c8af6cd4b806e4be2f4a05'
AND (
token = 'OHRn3i2yIyq0c+k5GIQXSIas/Ep2Fon9pDUj5goFUEw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)