UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eLJzklLvTsiwEnOaxYWQ4tIdRZzI9em1tD0zgZKhyuU=' 
WHERE 
  key_id = '1838bd4f1f29744b7b8c7c85a99e8787faaee8910ca0a2fd228498855668077a' 
  AND (
    token = 'eLJzklLvTsiwEnOaxYWQ4tIdRZzI9em1tD0zgZKhyuU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033