UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p3AIepiYBMCJUccTSIkCOlSKsDF98bPP4Ttxaj/tsVg='
WHERE
key_id = '0bd8568ebf59c0182b5687a7bd2cd51bbe50faf5afbbeab4ef4dcb580ffe97c0'
AND (
token = 'p3AIepiYBMCJUccTSIkCOlSKsDF98bPP4Ttxaj/tsVg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)