UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6czx/EeXEKinw7U3AI1EUqIbVQ9KWzK3cAxj/hwLx8o=' 
WHERE 
  key_id = '10e323f4ebbdcb5d7260f4ca1d9674c712764a1f0532e744361a6a9cfcb43149' 
  AND (
    token = '6czx/EeXEKinw7U3AI1EUqIbVQ9KWzK3cAxj/hwLx8o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036