UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '76qTUX8NtOXm1gevbdSwvQaiLg161HE+8DQQo5YoXPY=' 
WHERE 
  key_id = '31fc8ba9ee5da08c8fe37cf4368dabe4a6b23174b99868c3cff37bcb8394c2f9' 
  AND (
    token = '76qTUX8NtOXm1gevbdSwvQaiLg161HE+8DQQo5YoXPY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055