UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ga3HMoO5/7ZxPbPGAUSbZ2EvZkoodSdUXhY0bsiWC8E=' 
WHERE 
  key_id = '0030ec53772d1ae08853712622edb9da4ecb172dd740d175772873b2079316a0' 
  AND (
    token = 'ga3HMoO5/7ZxPbPGAUSbZ2EvZkoodSdUXhY0bsiWC8E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056