UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1YLCSE4cArUA2OL935ETsNBd/Jfmjmv6EqoNIKg5z/g=' 
WHERE 
  key_id = '56cac805cde0f7c64367df7fcde07f69b0d8cb3f56fc0450ce1f73e2ce15bf6d' 
  AND (
    token = '1YLCSE4cArUA2OL935ETsNBd/Jfmjmv6EqoNIKg5z/g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048