UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lWjMM5x2AsyyFwD4YTRPItBNZWDCX/NVK1L0NJmTPlo='
WHERE
key_id = 'f2f4c957f195e843f607b68b96019c6e03ec58471ca36a3bd9cd0d30241f13fd'
AND (
token = 'lWjMM5x2AsyyFwD4YTRPItBNZWDCX/NVK1L0NJmTPlo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)