UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9KrkWEIiVsa9ROQvNa75LWr1hEm79v8HeQraW9lbSHs=' 
WHERE 
  key_id = '229d2bca2a48f86d80ac5b81739ca48d7c88d420a763085ccca307efb3e041f3' 
  AND (
    token = '9KrkWEIiVsa9ROQvNa75LWr1hEm79v8HeQraW9lbSHs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040