UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N05Ud37agU9+AjZ9+jwXsGFeQpPcoFOZK6uZR7JPO9E=' 
WHERE 
  key_id = 'a8573fc0e2cb32b4e64f7ce4f09628fc74236c131a6a3aeb6ed87a0d2899aa51' 
  AND (
    token = 'N05Ud37agU9+AjZ9+jwXsGFeQpPcoFOZK6uZR7JPO9E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030