UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Abby78O8Tgo5dUk2YR/f0tDs7YniPWOU3AyJoi4VlLE='
WHERE
key_id = 'f51ae3f1b212acfc1444c3957a74410b2d4ee9dd1b690146f3c3db007ad1d44e'
AND (
token = 'Abby78O8Tgo5dUk2YR/f0tDs7YniPWOU3AyJoi4VlLE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)