UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lGF5gFMtuREGGMha/S8tBGzFePZzh20PIvmWtOzf/G4=' 
WHERE 
  key_id = '081a645fa56ebbfb83bcd6445f5b8e0febe414c2d6c3c7a8c401432ab631cedc' 
  AND (
    token = 'lGF5gFMtuREGGMha/S8tBGzFePZzh20PIvmWtOzf/G4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033