UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UBKLtoLJRLvufcWkeHzHcjWzannEzSov+ewZFe5EvzI=' 
WHERE 
  key_id = 'b80abc635c07197b276d67451dcc2145013cd57029f9c9aa4d57dd790406c742' 
  AND (
    token = 'UBKLtoLJRLvufcWkeHzHcjWzannEzSov+ewZFe5EvzI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026