UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '10vRP8cnfIj4vT6cn9100+m1O8xrYbPI8PKbw3m4hxU='
WHERE
key_id = 'f3646c768093fca7202d6aeacdddc88dc84680c3270d2dce2da5b134d3feece6'
AND (
token = '10vRP8cnfIj4vT6cn9100+m1O8xrYbPI8PKbw3m4hxU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)