UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lsM4FGOSPEmB6JHyJfebnQpEjKRi2c2LkgOr3PHJni0=' 
WHERE 
  key_id = '6d9232b2dc21c1f9b0bc37de9b5e3c9c3ec6877b3718f8cc89ee9f14c3d3822c' 
  AND (
    token = 'lsM4FGOSPEmB6JHyJfebnQpEjKRi2c2LkgOr3PHJni0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032