UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OqEHuhokf2rNb364//EzEA+0Qfz3B+ifw4V4RzGN1/I='
WHERE
key_id = 'fc1ed98f90e121dd0af528a299925f00cf9136ffaacfe368ac9c9562a3ac73b8'
AND (
token = 'OqEHuhokf2rNb364//EzEA+0Qfz3B+ifw4V4RzGN1/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)