UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vFZEeqrNZ/jT/oXRKotK3vLrQTaN7BYWd6w4LVPICas='
WHERE
key_id = 'c5a8918e81db2ebe11085698e3a01c1b9381480c0836517dfd43d3f1528311b5'
AND (
token = 'vFZEeqrNZ/jT/oXRKotK3vLrQTaN7BYWd6w4LVPICas='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)