UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ITQnnQeiodkKcPF6Zg4xnDNtQbfnDO3gaJHtOBMyyvo=' 
WHERE 
  key_id = '05b69b1e6cc6f142a00fe2157b9a7be77b3ba3c3e68b89f8f31ab829f37796ca' 
  AND (
    token = 'ITQnnQeiodkKcPF6Zg4xnDNtQbfnDO3gaJHtOBMyyvo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022