UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X7XWt/33iV7n3qmQ4AcoixDsY/wAeIfouNc8v3cdESY='
WHERE
key_id = '814e4863e07f351e20a669ac5ce6aded60c8d44bbd93eea5dd6153519d7154bb'
AND (
token = 'X7XWt/33iV7n3qmQ4AcoixDsY/wAeIfouNc8v3cdESY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)