UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KFrk+CXx5Be91q7n/tzZKUAS/ds9lfLryrKdn3B/cwM=' 
WHERE 
  key_id = '8dc101da4d9257c0d58fa68dc8124acfad0afbafbab5e05a892c833ec75153c2' 
  AND (
    token = 'KFrk+CXx5Be91q7n/tzZKUAS/ds9lfLryrKdn3B/cwM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039