UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uY2aG16egjGlnko5QwSyO5gflivuLYembOWSBwPkp0Y=' 
WHERE 
  key_id = '96b13df7da1d26f0458cb5ccc890e8e64ebff6639cff1b8d4d9f6a540efaf563' 
  AND (
    token = 'uY2aG16egjGlnko5QwSyO5gflivuLYembOWSBwPkp0Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035