UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aJEKDfARERTr9uyHQuxK4zCFqKQUyua+7rFKh0eV/RU=' 
WHERE 
  key_id = 'b49130dbb8d8b19d93f343eb2483bc5c2519d568b702e92acbde1092bf00f45a' 
  AND (
    token = 'aJEKDfARERTr9uyHQuxK4zCFqKQUyua+7rFKh0eV/RU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055