UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L6qub8v6fjHXK5f5aKvQxyWP+FLXk8S+qDXoe8RbszE=' 
WHERE 
  key_id = 'f716abce1475b8224951237a62dfeaa13d78a5d00e3d8f6c1e06dbe69731dbfe' 
  AND (
    token = 'L6qub8v6fjHXK5f5aKvQxyWP+FLXk8S+qDXoe8RbszE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023