UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6RGIiigLSnOECmuBqpzWwOWD5gRPTaWlEe9iOsUWnqk=' 
WHERE 
  key_id = '4dcb70560186ae486fb434ec56e37280efe17135c8e189462f4292e7a32d70fa' 
  AND (
    token = '6RGIiigLSnOECmuBqpzWwOWD5gRPTaWlEe9iOsUWnqk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053