UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7AWNTr2OtbgW5bDhYWpr1y/pJ8ERSEiGMKEmUtuqtMM=' 
WHERE 
  key_id = 'eaaf3a00f34e274a4e0fa9d50c5a8d4d02b89bc23a2870f871b95a5da8fa67f2' 
  AND (
    token = '7AWNTr2OtbgW5bDhYWpr1y/pJ8ERSEiGMKEmUtuqtMM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048