UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KsNQQITapVFXfRMoYTNqTE/UtbFRGPENSjwidgNosQ8='
WHERE
key_id = 'f8b7e011eb691a581b1db544dab6201b30cd11f5942e107b004d70344470bdeb'
AND (
token = 'KsNQQITapVFXfRMoYTNqTE/UtbFRGPENSjwidgNosQ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)