UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XuxJhE3+YWCIbe+oej4jwktJMfoNMRDGQHi+VZLCBkU='
WHERE
key_id = '414bfcb4cc733ea6c24170e0fc7fffaa4ee1f9fe03091bd1940a928fd4f1a005'
AND (
token = 'XuxJhE3+YWCIbe+oej4jwktJMfoNMRDGQHi+VZLCBkU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)