UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2chOWgBA8DzSC/vf7XDuzMjWiIqc1IaJrGSJkrwfc0A=' 
WHERE 
  key_id = 'a345265992301ab1fe3ef382eb722fe78eb8ab41c8b80814ee11454f2c06133d' 
  AND (
    token = '2chOWgBA8DzSC/vf7XDuzMjWiIqc1IaJrGSJkrwfc0A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018