UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y+SlI5fZ8G3NDIpC8YQj+4HT3XJ/S/al2zXmImUNSN8=' 
WHERE 
  key_id = '9913006063988f4ef7459083a7b432d4ae0194449001de9e5914f652de2dfa60' 
  AND (
    token = 'y+SlI5fZ8G3NDIpC8YQj+4HT3XJ/S/al2zXmImUNSN8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036