UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0C5BQZ7X0ip8Kv1EkdPG+WPFGqDD2x/BzZ6WWm9vCSA=' 
WHERE 
  key_id = '9856e9f002e14523fc9c98ebcf06751ba5287f5973a9bfb814f2daa60cc4bf4e' 
  AND (
    token = '0C5BQZ7X0ip8Kv1EkdPG+WPFGqDD2x/BzZ6WWm9vCSA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036