UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '33xV9QOWyV2LhuVCUPjc84NfbBdfH4cPpCAlweEHKsc='
WHERE
key_id = 'e757a6031453754cd9630eb4d61d29baab3036403cbef887a27c6eb151761e58'
AND (
token = '33xV9QOWyV2LhuVCUPjc84NfbBdfH4cPpCAlweEHKsc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)