UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NeO60s7VTi4fjprdofSaOJH706oD3UGED8a1m6IZZ3E=' 
WHERE 
  key_id = '13842a02b83cb0cecc4f076fa6e9d9fc6414f58ec5599181f2a5997a2775b81a' 
  AND (
    token = 'NeO60s7VTi4fjprdofSaOJH706oD3UGED8a1m6IZZ3E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041